home *** CD-ROM | disk | FTP | other *** search
- // Dynamic link library implementation of a generic output source
-
- #include "NSDLL.h"
-
- #define data(i,j) data[j+i*cols]
-
- /***************************/
- /* Activation of component */
- __declspec(dllexport) BOOL performOutput(
- DLLData *instance, // Pointer to instance data (may be NULL)
- NSFloat *data, // Pointer to the data
- int rows, // Number of rows of data
- int cols // Number of cols of data
- )
- {
- int i,j;
- NSFloat myOutput;
-
- for (i=0; i<rows; i++)
- for (j=0; j<cols; j++)
- myOutput = data(i,j); // You define your own output source.
- return TRUE; // Return wether or not the output component should still work
- }
-
- /******************************************/
- /* Management of instance data (OPTIONAL) */
- /*
- __declspec(dllexport) DLLData *allocOutput(
- DLLData *oldInstance, // Pointer to the last instance if reallocating
- int rows, // Number of rows of data
- int cols // Number of cols of data
- )
- {
- DLLData *instance = allocDLLInstance(oldInstance);
- return instance;
- }
-
- __declspec(dllexport) void freeOutput(DLLData *instance)
- {
- freeDLLInstance(instance);
- }
- */